<?php

function java($text){
	
preg_match("/'(.*)'/",$text[0], $matches);

return urldecode("%".$matches[1]);

}


if(isset($_POST['url'])){

	$url=$_POST['url'];
	if(preg_match("/greenhousenovels.com/i",$_POST['url'])){
		$html=file_get_html($url);
		$str= $html->find('.entry-content',0)->innertext;
	echo $str;
		exit();

	}

	if(preg_match("/cungquanghang.com/i",$_POST['url'])){
		$html=file_get_html($url);
		$str= $html->find('.entry-content',0)->innertext;
	echo str_replace('cungquanghang.com','',$str);
		exit();

	}
	if(preg_match("/hotconvert.com/i",$_POST['url'])){
		$html=file_get_html($url);
		$str= $html->find('.entry-content',0)->innertext;
	echo $str;
		exit();

	}
	

	if(preg_match("/kunnhi.wordpress.com/i",$_POST['url'])){
			$html=file_get_html($url);
			$html->find('.entry',0)->find('.wpa',0)->outertext='';
			$html->find('.entry',0)->find('.sharedaddy',0)->outertext='';
				$html->find('.entry',0)->find('.jp-relatedposts',0)->outertext='';
			
				$str= $html->find('.entry',0)->innertext;
			echo $str;
		
		exit();

	

	}


	if(preg_match("/tuyetlien90.wordpress.com/i",$_POST['url'])){
			$html=file_get_html($url);
			$html->find('.entry-content',0)->find('.wpa',0)->outertext='';
			$html->find('.entry-content',0)->find('.sharedaddy',0)->outertext='';
				$html->find('.entry-content',0)->find('.jp-relatedposts',0)->outertext='';
			
				$str= $html->find('.entry-content',0)->innertext;
			echo $str;
		
		exit();

	

	}
	if(preg_match("/ladyhouse00.wordpress.com/i",$_POST['url'])){
			$html=file_get_html($url);
			$html->find('.entry',0)->find('.wpa',0)->outertext='';
			$html->find('.entry',0)->find('.sharedaddy',0)->outertext='';
				$html->find('.entry',0)->find('.jp-relatedposts',0)->outertext='';
			
				$str= $html->find('.entry',0)->innertext;
				$str = str_replace('<span style="color:#ffffff;">qakldfghjktyuiozxcvbnm,sdf23455678945rfc8k76</span>', '', $str);
					$str = str_replace('<p>&nbsp;</p>', '', $str);
			echo $str;
		
		exit();

	

	}
	
		if(preg_match("/convert.hixx.info/i",$_POST['url'])){
			$html=file_get_html($url);
			$html->find('.div',1)->outertext='';
		
			
				$str= $html->find('.chi_tiet',0)->innertext;
				
			echo $str;
		
		exit();

	

	}
	
	
	if(preg_match("/fulltruyen/i",$_POST['url'])){
			$html=file_get_html($url);
			//$html->find('.contentPages',1)->outertext='';
		
			
				$str= $html->find('.contentPages',0)->find('div',2)->innertext;
				
			echo $str;
		
		exit();

	

	}
	
			if(preg_match("/123doc/i",$_POST['url'])){
							$data=doc123($_POST['url']);
					
					$tag="span";
				 $data=preg_replace('/<'.$tag.'[^>]*>/i', '', $data);
				   $data=preg_replace('/<\/'.$tag.'>/i', '', $data);
					echo $data;
				
					exit();
				
				//End of phantom
			}
			
			
			
				if(preg_match("/diendanlequydon.com/i",$_POST['url'])){
					$html=file_get_html($url);
					$str="";
					foreach($html->find('div.postbody') as $val){
						$text=$val->plaintext;
						if(strlen($text)>400){
							//Remove tag a
							$num_a=count($val->find('a'));
						
							if($num_a>0)
							for($i=0;$i<$num_a;$i++){
							
								$val->find('a',$i)->parent()->outertext='';
							}
							
							$str.="<p></p><div>---------------------------------------------------------</div><p></p>".$val->innertext;
						}
					}
				
					
							
							$tag="span";
								$str=preg_replace('/<'.$tag.'[^>]*>.{1,2}\s*<\/'.$tag.'>/i', '', $str);
							
					//$str = preg_replace_callback('/<script language="javascript">\s*(.*);\s*<\/script>/i', "java", $str);
				
					$str = preg_replace_callback('/ttdecode\(\'[^script]*\'\);/i', "java", $str);
					$str=str_replace('<script language="javascript">','',$str);
					$str=str_replace(' </script>','',$str);
					
					
						$str = preg_replace_callback('/ttdecode\(\'[^\s]*\'\);/i', "java", $str);
					
					
					
					
					$tag="span";
				 $str=preg_replace('/<'.$tag.'[^>]*>/i', '', $str);
				   $str=preg_replace('/<\/'.$tag.'>/i', '', $str);
					echo $str;
				
					exit();
				
				//End of phantom
			}
			
			if(preg_match("/truyenngontinh.com/i",$_POST['url'])){
			$html=file_get_html($url);
			//$html->find('.contentPages',1)->outertext='';
			$t=$str= $html->find('.entry-content',0);
			if($t){
			$str= $html->find('.entry-content',0)->find('p',0)->innertext;
			}else{
		//	$str= $html->find('.entry',0)->find('p',1)->innertext;
		    $html=$html->find('.entry',0);
			$html->find('.ann',0)->outertext='';
			$html->find('a',0)->outertext='';
			$html->find('.ratingblock',0)->outertext='';
			$html->find('.thumblock',0)->outertext='';
			$html->find('.chuyen-chuong',0)->outertext='';
			$html->find('div[style=display: none]',0)->outertext='';
			$html->find('div[style=display: none]',1)->outertext='';
			$str=$html->innertext;
			}
			echo $str;
			exit();

	

		}	

		

}


exit();
?>







